package GiaoHangVietNam.Entities;

import java.io.Serializable;
import java.util.ArrayList;

import android.text.TextUtils;

public class InterChangeInvoices implements Serializable{
	public short RegionID;
	public int OtherShipperID;
	// Tên shipper
	public String OtherName;
	public String Number; 
	public String Address;
	public double Lat;
	public double Lng ; 
	// Danh sách đơn hàng sẽ nhận
	public ArrayList<String> ListInvoiceReceive = new ArrayList<String>();
	 // Danh sách đơn hàng sẽ chuyển
	public ArrayList<String> ListInvoiceSend = new ArrayList<String>();
	 
	public  InterChangeInvoices(String[] fields)
	{
		if(fields.length == 10)
		{ 
			RegionID= Short.parseShort(fields[1]);
			OtherShipperID=Integer.parseInt(fields[2]);
			OtherName =fields[3];
			Number=fields[4]; 
			Address=fields[5];
			Lat = Double.parseDouble(fields[6]); 
			Lng = Double.parseDouble(fields[7]); 
			ListInvoiceReceive = new ArrayList<String>();
			ListInvoiceSend = new ArrayList<String>();
			
			String[] tmp1 =fields[8].split(";");
			if(tmp1.length >0)
			{
				for(int i=0;i<tmp1.length;i++)
				{
					if(tmp1[i] != null && !TextUtils.isEmpty(tmp1[i]))
						ListInvoiceReceive.add(tmp1[i]);
				}
			}
			String[] tmp2 =fields[9].split(";");
			if(tmp2.length >0)
			{
				for(int i=0;i<tmp2.length;i++)
				{
					if(tmp2[i] != null && !TextUtils.isEmpty(tmp2[i]))
						ListInvoiceSend.add(tmp2[i]);
				}
			} 
		}
	}

}
